<template>
    <el-dialog title="文件上传" :visible.sync="isUploadShow" :close-on-click-modal="false">
      <el-upload ref="elupload" class="upload" drag :action="importFileUrl" :data="upLoadData" :limit="1" :headers="httpHeaders" :auto-upload="false" :beforeUpload="beforeAvatarUpload" :onSuccess="uploadSuccess">
        <i class="el-icon-upload"></i>
        <div class="el-upload__text">将文件拖到此处，或
          <em>点击上传</em>
        </div>
         <div class="el-upload__tip" slot="tip">
           <el-button @click="uploadAction" slot="tip" type="primary">上传</el-button>
           <p>只能上传txt/word/excel文件</p></div>
      </el-upload>
    </el-dialog>
</template>
<script>
export default {
  name:"UploadShow",
  props:["isUploadShow","importFileUrl","upLoadData","httpHeaders", "uploadSuccess"],
  data(){
     return {}
  },
  methods:{
    uploadAction(){
      this.$emit('uploadAction')
    },
    beforeAvatarUpload(){
       this.$emit('beforeAvatarUpload')
    }
  }
}
</script>
